<?php
     //接受传递的分类的id
	 $id=$_GET['id'];
	     //引入配置文件
	 require '../public/config.php';
	 require '../public/mysql.php';
	 require '../public/function.php';
	 //连接数据库查询出所有的分类
	$link= connect();
	//准备SQL和执行sql
	if($link['error']){
	    $sql="select * from category";
	    $cates =query($link['mess'],$sql);
	}
   //调用查询子类的函数
   $childs = getChild($cates,$id);
   //将子类的数组转为以逗号分隔的字符串
    $childStr=implode(',',$childs);
//    var_dump($childStr);
	//查询出该分类下面所有的商品
   $sql="select * from goods where cid in($childStr)";
     //执行SQL语句
	 if($link['error']){
	   $goods =query($link['mess'],$sql);
	 }
	 var_dump($goods);
?>

<html>
    <head>
	    <title>商品列表</title>
		<meta charset="utf-8">
		<link type="text/css" rel="stylesheet" href="style/reset.css">
		<link type="text/css" rel="stylesheet" href="style/lb.css">
	</head>

    <body>
	    <div class="headerBar">
		
		<div class="topBar">
		        <div class="comWidth">
				    <div class="fl">
					<a href="###">点击收藏</a>
					</div>
					<div class="fr">
					 <a href="./登录.html">[登陆]</a> <a href="./注册.html">[免费注册]</a>
					</div>
				</div>
		</div>

         <div class="logoBar">
		      <div class="comWidth">
			      <div class="logo fl">
				    <a href="#"><img src="./images/logo.jpg" alt="汤浅蓄电池"></a>
				  </div>
				  <div class="search_box fl">
				      <input type="text" class="search_text fl">
					  <input type="button" value="搜 索" class="search_btn fr">
				  </div>
				  <div class="shopCar fr">
				      <span class="shopText fl">购物车</span>
					  <span class="shopNum fl">0</span>
				  </div>
			  </div>
		 </div>
<!--  导航-->
        <div class="nav">
		<div class="comWidth">
		   <div class="nav_left">
		     <h3>全部商品分类</h3>  
		   </div>
		    <ul class="nav_right">
			   <li class="nav_active1">电瓶上门</li>
			   <li class="nav_active">轮胎</li>
			   <li class="nav_active">保养</li>
			   <li class="nav_active">车品</li>
			   <li class="nav_active">轮毂</li>
			   <li class="nav_active">服务门店</li>
		    </ul>
		
		
		</div>
		</div>  

<!-- 内容 -->
         <div class="banner-top">
		   <a><img src="./images/lbtb.jpg" alt="瓦尔塔蓄电池"></a>
		 </div>
<!--图片结束  -->
    <div class="banner_head">
	    <dl class="banner_header">
		 <dt>品牌:</dt>
		 <dd class="islimit">汤浅</dd>
		 <dd>瓦尔塔</dd>
		 <dd>风帆</dd>
		 <dd>骆驼</dd>
		</dl>
        
		 <dl class="banner_header">
		 <dt>型号:</dt>
		 <dd>75D23L</dd>
		 <dd class="islimit">40B19L</dd>
		 <dd>65D23L</dd>
		 <dd><a>更多</a></dd>
		</dl>

			 <dl class="banner_header">
		 <dt>容量:</dt>
		 <dd>35AH</dd>
		 <dd>60AH</dd>
		 <dd  class="islimit">70AH</dd>
		 <dd><a>更多</a></dd>
		</dl>
	
		 <dl class="banner_header">
		 <dt>出厂月份:</dt>
		 <dd class="islimit">近一个月</dd>
		 <dd>近二个月</dd>
		 <dd>近三个月</dd>
		 <dd>近四个月</dd>
		</dl>
	    
		<dl class="banner_header">
		   <dt>汽车品牌:</dt>
		 <select>
		   <option value="1">本田</option>
		   <option value="2">雅阁</option>
		   <option value="3">思域</option>
		</select>
		<select>
			<option value="1">丰田</option>
			<option value="2">卡罗拉</option>
			<option value="3">雷凌</option>
		</select>
		<select>
			<option value="1">大众</option>
			<option value="2">朗逸</option>
			<option value="3">途观</option>
		</select>
		<select>
			<option value="1">马自达</option>
			<option value="2">阿特兹</option>
			<option value="3">昂克赛拉</option>
		</select>
		</dl>
	
	</div>

<!--       列表开始      -->
		   <div class="comWidth">
		       <div class="banner">
			       <div class="banner1"><a><img src="./images/ff.jpg" alt="风帆"></a></div>
			       <div class="banner2">
				      <span class="num">￥423</span>
				      <span class="label">免费上门</span>
				   </div>
			       <div class="banner3_name">
				     <a>风帆/sail 蓄电池 电瓶 以旧换新 55D23L</a>
				   </div>
			       <div class="banner4">
				     <span class="leftArea">累计成交<a>1704笔</a></span>
				     <span class="rightArea">|<a>产品详情></a></span>
				   </div>
			   </div>
<!--  -->
<div class="banner">
			       <div class="banner1"><a><img src="./images/55b24ls.jpg" alt="风帆"></a></div>
			       <div class="banner2">
				      <span class="num">￥423</span>
				      <span class="label">免费上门</span>
				   </div>
			       <div class="banner3_name">
				     <a>风帆/sail 蓄电池 电瓶 以旧换新 55D23L</a>
				   </div>
			       <div class="banner4">
				     <span class="leftArea">累计成交<a>1704笔</a></span>
				     <span class="rightArea">|<a>产品详情></a></span>
				   </div>
			   </div>
<!--  -->
<div class="banner">
			       <div class="banner1"><a><img src="./images/varta.jpg" alt="风帆"></a></div>
			       <div class="banner2">
				      <span class="num">￥423</span>
				      <span class="label">免费上门</span>
				   </div>
			       <div class="banner3_name">
				     <a>风帆/sail 蓄电池 电瓶 以旧换新 55D23L</a>
				   </div>
			       <div class="banner4">
				     <span class="leftArea">累计成交<a>1704笔</a></span>
				     <span class="rightArea">|<a>产品详情></a></span>
				   </div>
			   </div>
<!--  -->	   <div class="banner">
			       <div class="banner1"><a><img src="./images/56093.jpg" alt="风帆"></a></div>
			       <div class="banner2">
				      <span class="num">￥423</span>
				      <span class="label">免费上门</span>
				   </div>
			       <div class="banner3_name">
				     <a>风帆/sail 蓄电池 电瓶 以旧换新 55D23L</a>
				   </div>
			       <div class="banner4">
				     <span class="leftArea">累计成交<a>1704笔</a></span>
				     <span class="rightArea">|<a>产品详情></a></span>
				   </div>
			   </div>
<!--  -->
  <div class="banner">
			       <div class="banner1"><a><img src="./images/fl.jpg" alt="风帆"></a></div>
			       <div class="banner2">
				      <span class="num">￥423</span>
				      <span class="label">免费上门</span>
				   </div>
			       <div class="banner3_name">
				     <a>风帆/sail 蓄电池 电瓶 以旧换新 55D23L</a>
				   </div>
			       <div class="banner4">
				     <span class="leftArea">累计成交<a>1704笔</a></span>
				     <span class="rightArea">|<a>产品详情></a></span>
				   </div>
			   </div>
<!--  -->
  <div class="banner">
			       <div class="banner1"><a><img src="./images/drf.jpg" alt="风帆"></a></div>
			       <div class="banner2">
				      <span class="num">￥423</span>
				      <span class="label">免费上门</span>
				   </div>
			       <div class="banner3_name">
				     <a>风帆/sail 蓄电池 电瓶 以旧换新 55D23L</a>
				   </div>
			       <div class="banner4">
				     <span class="leftArea">累计成交<a>1704笔</a></span>
				     <span class="rightArea">|<a>产品详情></a></span>
				   </div>
			   </div>





		   </div>




    
<!--底部   -->
                         <div class="hr"></div>
						 <div class="footer">
                            <p><a href="#">汤浅简介</a><i>|</i><a href="#">招兵买马</a><i>|</i><a href="#">汤浅新闻</a><i>|</i><a href="#">广告与市场合作</a><i>|</i><a href="#">联系我们</a></p>
                            <p>© 2004-2016 beixing.cn Corporation, All Rights Reserved 北星苏州有限公司 版权所有 苏ICP备11004912号</p>
                            <p class="web"><a href="#"><img src="images/chengxin.png" alt="logo"><a><a href="#"><img src="images/chengxin.png" alt="logo"><a><a href="#"><img src="images/chengxin.png" alt="logo"><a><a href="#"><img src="images/chengxin.png" alt="logo"><a><a href="#"><img src="images/chengxin.png" alt="logo"><a></p>
						</div>




























	</body>
</html>